
//
//  StatusModel.swift
//  weiboLQ
//
//  Created by 半缘君 on 15/12/11.
//  Copyright © 2015年 banyuanjun.cn. All rights reserved.
//

import UIKit

class StatusModel: NSObject {
    
    /// 微博ID
    var id: Int = 0
    /// 微博信息内容
    var text: String?
    /// 微博创建时间
    var created_at: String?
    /// 微博来源
    var source: String?
    /// 用户模型
    var user: UserModel?
    /// 缩略图URL
    var pic_urls:[[String:String]]?
    /// 被转发的原微博信息字段
    var retweeted_status: StatusModel?
    
    init(dic:[String:AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dic)
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    override func setValue(value: AnyObject?, forKey key: String) {
        if key == "user" {
            user = UserModel(dic: value as! [String:AnyObject])
            return
        }
        if key == "retweeted_status" {
            let dict = value as! [String:AnyObject]
            retweeted_status = StatusModel(dic: dict)
            return
        }
        super.setValue(value, forKey: key)
    }
    override var description:String {
        return printClass(self.classForCoder)
    }

}
